home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DDJMAG / DDJ9203.ZIP / OOPASM.ZIP / DLGHMENU.ASM < prev    next >
Assembly Source File  |  1990-06-05  |  2KB  |  71 lines

  1.     .MODEL    SMALL
  2.  
  3.     INCLUDE    equates.inc
  4.     INCLUDE    instance.inc
  5.     INCLUDE    messages.inc
  6.     INCLUDE    objects.inc
  7.  
  8. IF1
  9.     INCLUDE    macros.mac
  10.     INCLUDE    objects.mac
  11. ENDIF
  12.  
  13.     EXTRN    HorzMenu:WORD
  14.     EXTRN    Self:WORD
  15.  
  16.     .CODE
  17.  
  18. COMMENT    %
  19. ==============================================================================
  20. Sets DlgHMenu's instance variables with values handed down from the master.
  21.  
  22. =============================================================================%
  23. setDHMVars    PROC    NEAR
  24.     push        Self
  25.     getInst$    ch,Row2,MasterObj    ;Get upper row from master
  26.     getInst        cl,Col1            ;Get left column
  27.     getInst        di,MenuTbl        ;Get menu tbl ptr
  28.     getInst        ax,MenuPtr        ;Get menu ptr
  29.     getInst        bx,DispTbl        ;Get dispatch tbl ptr
  30.     getInst        dl,Color        ;Get color
  31.  
  32.     sub        ch,RowOffset        ;Subtract row offset
  33.     add        cl,ColOffset        ;Add in column offset
  34.  
  35.     setInst        MenuPtr,ax,DlgHMenu    ;Set menu ptr
  36.     setInst        MenuTbl,di        ;Set menu tbl ptr
  37.     setInst        DispTbl,bx        ;Set dispatch tbl ptr
  38.     setInst        Row1,ch            ;Set upper row
  39.     setInst        Row2,ch            ;Set lower row
  40.     setInst        Col1,cl            ;Set left column
  41.     setInst        Col2,cl            ;Set right column
  42.     setInst        Color,dl        ;Set color
  43.     pop        Self
  44.     ret
  45. setDHMVars    ENDP
  46.  
  47.  
  48.  
  49.     .DATA
  50.  
  51. defMsg    DlgHMenu,\
  52.     Refresh,\
  53.     <setDHMVars,,>
  54.  
  55. defObj    DlgHMenu,\
  56.     <HorzMenu>,\
  57.     <Row1,1,13,\
  58.     Col1,1,17,\
  59.     Row2,1,13,\
  60.     Col2,1,63,\
  61.     Color,1,Nil,\
  62.     TxtPtr,2,Nil,\
  63.     InxPtr,2,0,\
  64.     MasterObj,2,Nil,\
  65.     DispTbl,2,Nil,\
  66.     MenuPtr,2,Nil,\
  67.     MenuTbl,2,Nil>,\
  68.     <Refresh,Read,Next,Prev,Select,Clear,Hilite>
  69.  
  70.     END
  71.